package lero.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * 作者: lero
 * 日期：2018/7/16
 */

public class Article {
    private int id;
    private String title; //标题
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date createTime;//发布时间
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date updateTime;//最后修改时间
    private Category category;//所属分类
    private String content;//内容
    private boolean hotOrNot=false;//是否置顶,默认不是热门
    private boolean viewOrNot=true;//是否可见，默认可见


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public Category getCategory() {
        return category;
    }

    public void setCategory(Category category) {
        this.category = category;
    }

    public String getContent() {
        return content;
    }

    public void setContent(String content) {
        this.content = content;
    }

    public boolean isHotOrNot() {
        return hotOrNot;
    }

    public void setHotOrNot(boolean hotOrNot) {
        this.hotOrNot = hotOrNot;
    }

    public boolean isViewOrNot() {
        return viewOrNot;
    }

    public void setViewOrNot(boolean viewOrNot) {
        this.viewOrNot = viewOrNot;
    }

    @Override
    public String toString() {
        return "Article{" +
                "id=" + id +
                ", title='" + title + '\'' +
                ", createTime=" + createTime +
                ", updateTime=" + updateTime +
                ", category=" + category +
                ", content='" + content + '\'' +
                ", hotOrNot=" + hotOrNot +
                ", viewOrNot=" + viewOrNot +
                '}';
    }
}
